using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace TextEditorDP
{
    public abstract class Assert<Item>
    {

        /**
         * To make sure the object is not null.
         * @param o The object to be tested.
         */
        public static bool checkNull(Object o) 
        {
            if (o == null)
                return true;
            return false;
	    }

        /**
         * To make sure the index is in the bound of the collection.
         * @param index The index to be tested.
         * @param c The collection to be operated.
         */
        public static bool checkRange(int index, List<Item> c) 
        {
		    if (c != null)
                if ((index >= 0) && index < c.Count)
                    return true;
            return false;
	    }

        /**
         * To make sure the boolean is true.
         * @param b The boolean value to be tested.
         */
        public static bool checkTrue(bool b) 
        {
            return b;
	    }

        /**
         * To make sure the two Objects are equals.
         * @param obj1 The object 1 to be tested.
         * @param obj2 The object 2 to be tested.
         */
        public static bool checkEquals(Object obj1, Object obj2) 
        {
            if (obj1.Equals(obj2))
                return true;
            return false;
        }
    }
}
